package org.inspursc.s0517.health.evaluation.converter;

import org.inspursc.s0517.health.evaluation.dto.QuestionDTO;
import org.inspursc.s0517.health.evaluation.entity.Question;
import org.springframework.beans.BeanUtils;

/**
 * @author B_Dream
 * @date 2018/5/24 11:50
 */
public class QuestionConverter {
    public static Question converter(QuestionDTO questionDTO) {
        Question question = new Question();
        BeanUtils.copyProperties(questionDTO, question);
        return question;
    }

    public static QuestionDTO converters(Question question) {
        QuestionDTO dto = new QuestionDTO();
        BeanUtils.copyProperties(question, dto);
        return dto;
    }
}
